package qos.estimator.statistics;

import java.util.Map;
import java.util.StringTokenizer;

public class CPUPercentageCollectorStrategy implements CPUCollectorStrategy {

	public void extract(String header, StringTokenizer st,
			Map<String, Double> cpuUtilization) {
		cpuUtilization.put("%usr", Double.valueOf(header.replace(",", ".")));
		cpuUtilization.put("%nice", Double.valueOf(st.nextToken().replace(",", ".")));
		cpuUtilization.put("%sys", Double.valueOf(st.nextToken().replace(",", ".")));
		cpuUtilization.put("%iowait", Double.valueOf(st.nextToken().replace(",", ".")));
		cpuUtilization.put("%soft", Double.valueOf(st.nextToken().replace(",", ".")));
		cpuUtilization.put("%steal", Double.valueOf(st.nextToken().replace(",", ".")));
		cpuUtilization.put("%guest", Double.valueOf(st.nextToken().replace(",", ".")));
	}

	
}
